package com.junge.start;

import java.net.URL;

import com.junge.javafx.DialogShowMessage;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

/**
 * 类描述 :
 * @author xiaojun.yin
 * @version 1.0
 * 2019年1月24日 上午9:27:55
 */
public class StartMain extends Application{

	@Override
	public void start(Stage paramStage) throws Exception {
		URL url = this.getClass().getResource("/resources/fxml/Helloworld.fxml");
		Parent root = FXMLLoader.load(url);
//		Parent root = FXMLLoader.load(getClass().getResource("/fxml/Helloworld.fxml"));
		 paramStage.setTitle("时间工具");
         paramStage.setScene(new Scene(root));
         paramStage.show();
         paramStage.setResizable(false);
         paramStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
			@Override
			public void handle(WindowEvent we) {
				we.consume();
				DialogShowMessage.showExitMessage(paramStage);
			}
		});
	}
	
	public static void main(String[] args) {
		launch(args);
	}

}
